package com.aaa.service.impl;

import com.aaa.service.EmpService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.aaa.dao.EmpDao;
import com.aaa.entity.Emp;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;


@Service
public class EmpServiceImpl extends ServiceImpl<EmpDao,Emp> implements EmpService {

    @Autowired
    private EmpDao empDao;

    @Override
    public Result<Page<Emp>> findByPage(Integer currentPage, Integer pageSize) {
        Page<Emp> page = new Page<>(currentPage,pageSize);
        Page<Emp> empPage = empDao.selectPage(page, null);

        return new Result<>(200,"查询成功",empPage);
    }

    @Override
    public Result<IPage<Emp>> queryDate(Integer currentPage, Integer pageSize) {
        Page<Emp> page = new Page<>(currentPage, pageSize);
        IPage<Emp> empIPage = empDao.queryData(page, null);
        return new Result<>(200,"查询成功",empIPage);
    }


}
